Copyright: TimeWarp (c) 1994 Bruce Powel Douglass, PhD


TimeWarp

by A Priori Software (c) 1994

What is TimeWarp?

Installing TimeWarp

License, Restrictions, and Warranties OH MY!

Registering Your Copy of TimeWarp

Restrictions on Unregistered Versions

What Do You Get When You Register?

Introduction to TimeWarp

Navigating Through TimeWarp

The TimeWarp Object Page

The State Window

The Transition Page

The Diagram Page

Spreadsheet Features

About A Priori Software


What is TimeWarp

TimeWarp is a program that allows the construction of timing diagrams from descriptions of objects state behavior. These objects may be simple binary state devices, such as wires on a hardware breadboard, or they may be more elaborate multistate objects with arbitrarily complex lifecycles. These timing diagrams may be copied to the clipboard as Windows metafiles or printed using standard Windows printers.


Installing TimeWarp

To install TimeWarp copy all the files ending with a VBX extension into your windows SYSTEM directory. Copy all the remaining files into a directory of your choice, e.g., C:\TW.

Create a new program group called TimeWarp using the Program Manager. Start the File Manager and click once on the TimeWarp program TIMEWARP.EXE. While holding down the left button, drag the cursor to the new program group and then let go of the left mouse button. This will drag the file from the File Manager to your new Program Manager group.

To run the program, position the mouse over the icon in the Program Manager group, and double click.


LICENSE
License, Restrictions, and Warranties OH MY!

The use of  TimeWarp is totally without warranty. The program has been checked for errors, however should damage to you, your equipment, or data occur as a result of using this program, whether it be through proper or improper use, A Priori Software and its owners are completely without liability. Use of this software constitutes an agreement to waive all rights to damages caused by, or purported to be caused by, this software. ANY OTHER USE CONSTITUTES AN ILLEGAL USAGE OF THIS PROGRAM.

Unregistered users may copy and distribute the program freely and may use it forever, provided that they not violate the above license. There are some restriction built in to the unregistered copies so that they are not as functional or as useful as their registered siblings, but you get what you pay for.

Registered users may not distribute their registration license nor any upgraded versions of this program. To do so violates US Copyright law and is a very, very bad thing.


Registering Your Copy of TimeWarp

To get a hard copy of this order form, select the Help File Menu, Print Topic Option.

To Register by Mail (Check or Money Order; US Funds Only)

Name:______________________________________________________________________

Street Address: _______________________________________________________________

Street Address: _______________________________________________________________

City: _______________________________    State: _______________    Zip: ______________

Country: ____________________________    Telephone: ______________________________

How did you learn about TimeWarp? _______________________________________________

Please send a check or money order for $199.00 per copy plus $5.00 s/h.

A Priori Software
5409 North Pass
McFarland, WI 53558
(608) 838-6189
CIS: 70673,2715

For 5-10 copies, the per copy cost is $149. For more than 10 copies, the cost is $99.00 per copy. Contact A Priori Software for site license fees.


Restrictions on Unregistered Versions

While you have unlimited use of an unregistered version, its functionality is purposefully limited in the following ways:

•	The number of objects you may have in an object file is restricted to 3.

•	The number of states within an object is restricted to 5.

•	You get banners saying UNREGISTERED COPY on printouts or copied  results.

•	The startup page is the Registration Page.


WHAT DO YOU GET WHEN YOU REGISTER
What Do You Get When You Register?

•	The latest version of TimeWarp.

•	 (Registered) TimeWarp has no reasonable limits on the number of objects, transitions, or states.

•	(Registered) TimeWarp has no annoying messages on printouts.

•	 (Registered) TimeWarp startup page is the Object page.

•	 Printed manual


Introduction  to TimeWarp

TimeWarp is a program to help you model the interactions of state machines as they occur in linear time. This is graphically depicted using a timing diagram. Although most electrical engineers use timing diagrams, most software engineers do not. Booch '91 (see Object Oriented Design, 1991 by Grady Booch, Benjamin/Cummings Press) advocates the use of timing diagrams for the specification of timeing behavior in object interactions. This program is flexible enough to be used by both disciplines.

An object as we will use the term here, is an entity that has distinct states during its existence or lifecycle. For example, a half-duplex communications port can be:

•	Quiet

•	Receiving Characters

•	Sending Characters

•	Unable to Send or Receive (error state)

In a simple hardware system, the traces that constitute the data bus lines each can be

•	On

•	Off

•	High Impedance State

If the data bus consists of  8 lines, and the lines are all tristated together for the high impedance state, then the data bus, as an object, has 257 states.

The states of an object, or of several objects, can be plotted against time in a timing diagram. This time variant behavior is generally not a static characteristic of an object or a group of objects, but depicts a particular sequence of  events (called a scenario) and the time relationships among the objects and their states.

A state is a condition in which an object resides for a significant period of time which is distinguishable from other such conditions, perhaps in the object's behavior or in its attributes ("the manager is mad (state) when he screams (behavior) and his face is bright red (attribute)").

A transition is a transitory event that signals an object to move from one state to another. The state of the object when it receives the transition is called the starting state, and the state it ends up in after the transition is its ending state. Note that the starting and ending states for a transition may be the same, although this is not detectable from the timing
diagram.

Transitions may have multiple instances. An instance of a transition is when that transition occurs between two particular states at a particular time. For example, a transition named  Timeout may occur between states Waiting To Send and Sending  as well as between  states Waiting to Receive and Receiving. Each occurrence is such an instance. In TimeWarp, a given transition may only have a single instance for a specific starting state.  Thus starting state Waiting to Send may have only one transition to another state which is  an instance of Timeout. Transitions are traditionally associated with conditions (the events causing the transition) and actions (things that the object does as the it moves to its new state).

Time is measured in time units. In TimeWarp, these units are unspecified, and so may be any useful duration. They are assumed to be within the range of integers; i.e. -32,768 to 32,767.

A starting time is a characteristic of a transition instance and specifies in time units when the instance occurs. The Maximum Lag Time is the longest time after the instance start time that the transition may actually start. For many modelling problems, this may be assumed to be zero. In other situations, the lag time is important; for example, if the operating system task switching system has a minimum and maximum duration for the context switch, it may be important to model this lag. The rise time is the amount of time the transition requires to complete. Again, in many sitations, transitions are assumed to take zero time, but there are cases where the transition time is significant.

An object that exhibits state behavior (not all objects do, you know) is also known as a Finite State Machine or FSM. FSMs are traditionally shown as either State Diagrams, of which there are several diagrammatic notations, or as State Tables. TimeWarp using State Tables and Transition Tables using a spreadsheet interface to allow you to capture the state and time behavior of the objects, and from those tables, TimeWarp can generate timing diagrams.


Navigating Through TimeWarp

There are several "pages" associated with the main window, plus an additional state transition matrix window. The pages include

•	Object Page - this allows you to create, save, and load object files. Object files contain multiple objects with references to their state transition files.

•	Transition Page - this is where you can add states to your objects and specify information about the transitions such as the starting state, transition name, time of transition, maximum lag time for the transition, ending state, and rise time (time for the transition itself to complete). One this page you may also plot the current object state machine.

•	Diagram Page - this is where you plot the system of objects' state machines all along the same time axis.

•	Quit (Virtual) Page - this page doesn't really exists - selecting this option terminates the program.

In addition, there is a State Transition Window which may be open simultaneously with the pages listed above.

Navigation to the above screen occurs by simply clicking the left mouse button at the top of the main window on the file tab that associates with the page you want. The State Transition Window is brought up by clicking on the State button, available on the Object and Transition pages.


The TimeWarp Object Page

Loading and Saving Object Files

The Object Page allows you to create, load, and save Object files. Object files have a .OB extension and contain references to other files that contain the actual objects and descriptive information about their states, transitions, and timing. When starting, you can Load the JUGGLE.OB file by clicking on Load. You will notice that the first object in that file, BALL 1, is selected. If you now go to the State window by clicking on the State button, or to the Transition page, by clicking on the Transition tab, you will see state transition information for that object.

The list box at the left of the Object page contains a list of all the objects in the Object file. You may pull down the list and select a new one; when you do so, it is automatically loaded.

Creating Object Files

To create a new object file, click on the New button on the Object Page. If the old object file has been changed, you will be asked to save it.  You will then be asked for a scenario name. Some object systems have behavior that is fixed, but others have more dynamic behavior. TimeWarp allows you to model multiple scenarios with the same set of objects (one scenario per object file) to explore and document the timing characteristics of these scenarios. The scenario name helps you keep the scenarios straight.

Adding and Deleting Objects in the Object File

An object file starts out with no objects. To get started, you must first create a new object. Click on the Add button. You will be asked for the name of the object and a file. If the object itself is new (it is possible to Add an existing object to a new object file), you may enter a name and a filename. If the object exists, you may click on the Browse button to view existing transition files. Transition files contain information about one, and only one, object. They have a .TRN extension.

After you load or create a new transition file, click on the Transition tab or the States button to edit the object's information.

To remove an object from the Object file, select it and click on the Delete button. The object is removed from the object file. NOTE: The object's transition file is not deleted from disk by this procedure, so it remains available for inclusion into other object files!


The State Window

Saving and Loading Transition Files

If you have loading an object file from the object page, then the first object is automatically loaded. If not, or if you want to load a new object, you may click on the Load button. The object need not be part of the current object file to be loaded independently. If the desired object is contained in the current object file, the easiest way to load it is to select it from the object list box.

The State Window allows you to enter the basic state transition information into a State Transition Table (STT). A spreadsheet is used to hold the STT. The first column holds the starting state; each transtion forms another column. The contents of transition column is the target state into which the object arrives subsequent to the transition.  For example:

You may also notice parenthetical data in the transition columns. These indicate the timing parameters for the transition. For example,

Traveling Right(10; 2; 1)

Indicates that for that particular instance of the transition, the target state is Traveling Right, the start time for the transition is at time = 10, the maximum lag is 2 time units, and a transition completion time (aka rise time) is 1 time unit. These may be entered in this spreadsheet using parentheses and separated by semicolons, or entered in the appropriate columns in the Transition Page.

Adding and Deleting States

Click on the Add State button to add a state. You will be asked for the name of the state. Once you add a new state, it becomes the selected state, available for immediate use.

To delete a state, select the state to delete in the State list box, and click on the Delete State button. The state is removed from that object.

Adding and Deleting Transitions

Adding transitions is similar to adding and deleting states. When you add a transtion, a new column will be added to the STT. The column titles are the names of the transitions.

Filling in State fields

Where ever a state name is expected, you can paste the the currently selected state (see the State List box). If you select the desired state (pull the state list down, and click on the desired state), then double-click on the entry field, the currently selected state is pasted into that field. On the State Window, valid positions for pasting state names are

•	Any cell in the spreadsheet either in the the starting state row or in a
transition target state column.

•	The Starting State field

Setting Periodic

By clicking on the Periodic checkbox, the object may be toggled from periodic to aperiodic.

Make

The Make option translates the current STT information to the Transition page, overwriting what is currently there. This allows you to make changes to the object transition information from either the State Window or the Transition Page. If you leave the State Window and have modified the data, you will be asked if you want to update the Transition Page. If you do not, then the data in the two spreadsheets will be inconsistent.

Printing and Copying

The Print and Copy buttons print or copy the data in the STT to the Windows default printer or Windows clipboard, respectively. The size of the font is adjusted to attempt to fit the text on the printer page. The current column width is used for the printing. Note that because of the differences in display and printer fonts, the best looking display column width is probably not the best printer column width. The Auto-Adjust button adjusts the widths of the columns to what it thinks is the best printer column widths. You may also manually adjust the column widths. See the section Spreadsheet Features for more information.

Coalescing

Coalescing the state spreadsheet is nothing more than collapsing certain spreadsheet rows together, i.e. those with a common starting state. This makes for a more compact display. Under certain circumstances, TimeWarp will perform this automatically.

Sorting

Sorting the STT spreadsheet sorts by starting state. This is distinction from the Transition spreadsheet which sorts by transition starting time.

Close

The Close option simply closes the State Window. Note that the State Window can be open at the same time as any of the pages, allowing you to manipulate the data as you wish.


The Transition Page

The Transition Page is the other primary data entry page. In it you can add and delete states, add and delete transitions, characterized transitions, copy and print the transition information, etc.

Add and Delete States

This works in the same manner as it does for the State Window.

Adding and Deleting Transitions

Transitions are added by typing the data into a new row. You must provide the starting state, the transition name, the starting time for the transition, the maximum lag time, ending state (after the transition completes), and the rise time.

Plotting the Object State Machine

The current object's state machine may be plotted as a single object timing diagram by clicking on the plot button. An example is shown in the figure above.

The object timing diagram may be manipulated using the graph popup menu. To use it, position the cursor over the graph, and click the right mouse button. A menu will appear with the following options:

•	Print Plot	this option prints the object timing diagram

•	Copy Plot	this option copies the object timing diagram to the Windows clipboard as a Windows metafile

•	Maximize Plot	this option enlarges the timing diagram, overlaying the spreadsheet

•	Minimize Plot	this option returns the timing diagram to its normal size

Saving and Loading Transition Files

Transition files may be saved and loaded using the Save and Load buttons, respectively. Transition file have the extension .TRN.

Printing and Copying

The transition table data may be printed to the default Windows printer or copied to the Windows clipboard by clicking on the Print and Copy buttons respectively. When printing, the text size is changed to try to fit the data all on the printer. The current column widths are used, which may not be the best for printing. If you click on the Auto Width button, TimeWarp will try to select the best column widths for printing. If the data still doesn't print all on one line, you can try using the Windows Control Panel to modify the printer orientation to landscape, or you can copy the information to the clipboard and paste it into another application, such as a text editor, for further manipulation.

Inserting and Deleting Rows

Rows may be inserted and deleted in the Transition spreadsheet by selecting the row and cliclicking on the appropriate button. Multiple rows may be inserted or deleted by selecting multiple rows prior to clicking on the buttons. To select multiple rows, click on either the first or the last row desired, and while holding down the left button, drag the cursor to the last or first row, respectively.


The Diagram Page

The Diagram Page is for plotting multiple objects along the same time axis.  This is where the true value of TimeWarp can be seen.

Selecting Objects to Plot

TimeWarp allows you to plot some or all of the objects in your scenario on the same plot. If you click on the Plot button without selecting any items. it is assumed that you wish to plot all the objects. Otherwise, you may select objects in the Available Objects List and move them to the Objects To Plot List by either double clicking on them or by clicking on the Add button. Similarly, removing objects from the Objects to Plot List can be done by double clicking on them or selecting them and clicking on the Remove button.

Plotting

The Plot button plots the selecting objects with respect to the time period specified. Lag time are not plotted on this window to keep the diagram more readable.

A state legend pops up when you plot which identifies the value on the Y axis with a particular state of a particular object.

Printing and Copying

Once you've plotted a set of objects, you may Copy them (as a Windows metafile) to the Windows clipboard. From there, they may be pasted into a word processing file (using a word processor such as Word Perfect, Word for Windows, or even Windows Write) or print them.


Spreadsheet Features

Changing Spreadsheet Colors

Position the cursor over the spreadsheet and click the right mouse button. A small popup menu appears, allowing you to change foreground and background colors, and insert and delete rows. Select Foreground Color or Background Color to set the appropriate color. A color dialog will appear and allow you to select the color. These colors will be applied immediately, and also saved for the next time you run TimeWarp.

Inserting and Deleting Rows

Position the cursor over the spreadsheet and click the right mouse button. A small popup menu appears, allowing you to change foreground and background colors, and insert and delete rows. The Insert Rows and Delete Rows options work just like the Insert and Delete buttons on the Transition Page.

Adjusting Column Widths

To change the widths of individual columns move the cursor to the grid line indicating the rightmost boundary of the column. The cursor changes to a two-sided arrow. Hold down the left button and drag the column border to the desired width.

Auto-Adjust Column Widths

The Autowidth button sets the column widths to be wide enough so that the column will be fully printed on the printer. It generally looks too wide on the screen.

Printing

TimeWarp tries to autoadjust the printer font size so that the text can fit on the page. If there are more transitions than can be handled, try using the Windows Control Panel Printer setup to change the page orientation to landscape. Alternatively, you can Copy the spreadsheet information to the clipboard and then Paste it into another application, such as a text editor (e.g. Notepad) to manipulate it to your liking.


About A Priori Software

A Priori Software specializes in

•	Numerical Analysis

•	Scientific Computing

•	Statistical Analysis

•	Object Oriented Software Analysis and Design Methodology

•	Neural Networks and Fuzzy Logic

•	Real-time, high reliability embedded systems

A Priori Software does both training and consulting.  We can be contacted at :

A Priori Software
5409 North Pass
McFarland, WI 53558
(608) 838-6189
Compuserve 70673,2715


A Priori Software

A Priori specializes in scientific, object oriented, artificial intelligence, and embedded real-time software.


ending state

the state an object ends up in following a transition


Finite State Machine

a kind of object that has discrete modes of behavior called states.


instance of a transition

a particular transition with a unique starting state. Transitions may have instance from many different starting states, but only one per starting state.


Lag

the maximum time after a transition occurs at which the object will change state


rise time

the time requried for a transition to complete. Frequently, this is assumed to be zero.


starting state

the state of the object before it receives a transition


state

a condition in which an object resides for a significant period of time


Time

assumed to be in the range -32,768 .. 32,767


TimeWarp

TimeWarp -- The Timing Diagrammer for Windows. From A Priori Software.


transition

a transitory event that signals an object to move from one state to another